package com.googlecode.data.materials
{
	import com.googlecode.data.IValueObject;
	
	import flash.display.DisplayObject;
	
	public class MovieMaterialVO extends FileAssetMaterialVO
	{
		public static const TYPE:String = "MovieMaterial";
		
		public var animated:Boolean = true;
		
		public var swf:DisplayObject;
		
		public var transparent:Boolean = true;
		
		public var showControls:Boolean = false;
		
		public function MovieMaterialVO()
		{
			this.smooth = true;
		}
	
		override public function clone(src:* = null):IValueObject
		{
			var clone:IValueObject = super.clone(new MovieMaterialVO());
			
			(clone as MovieMaterialVO).animated = this.animated;
			(clone as MovieMaterialVO).swf = this.swf;
			(clone as MovieMaterialVO).transparent = this.transparent;
			(clone as MovieMaterialVO).showControls = this.showControls;
			
			return (clone as MovieMaterialVO);
		}
		
		override public function toXML(src:XML = null):XML
		{
			var xml:XML = super.toXML(new XML(<{TYPE} face={this.face}></{TYPE}>));
			
			xml.appendChild(<showControls>{this.showControls}</showControls>);
			
			return xml;
		}
		
		override public function fromXML(src:XML):void
		{
			super.fromXML(src);
			
			this.showControls = src.showControls == "true" ? true : false;
		}
	}
}